<?php
declare (strict_types = 1);

namespace app\home\validate;

use think\Validate;

class Register extends Validate
{

    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        "phone" => "require|mobile|unique:user",
        "code" => "length:4",
        "password" => "length:6,12",
        "repassword" => "length:6,12|confirm:password",
        "m1" => "eq:2"
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'phone.require' => '手机号必填',
        'code.length' => '验证码只能是四位',
        'password.length' => 'password',
        'repassword.length' => 'repassword',
        'm1.eq' => '协议必须选择',
    ];
}
